﻿using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Threading;
using System.Reflection;

namespace Ecosystème
{
#if WINDOWS || XBOX
    public partial class ParametrePartie : Form
    {
        String cheminXML = Path.GetDirectoryName(Assembly.GetAssembly(typeof(ParametrePartie)).CodeBase) + "/listeEtreVivant.xml";
        public frmPlateau plateau;
        //private Form f;

        public ParametrePartie()
        {
            InitializeComponent();
            Arborescence arbre = new Arborescence(cheminXML, TVAnimauxPresents);
        }


        private void btnStart_Click(object sender, EventArgs e)
        {
            // plateau = new frmPlateau();

            
            this.Hide();
            Thread theThread = new Thread(creerTheadGame);
            theThread.Start();
        }

        public void creerTheadGame()
        {
            //plateau = new frmPlateau();

            //Game1 game = new Game1(plateau.getDrawSurface());
            //game.plat = plateau;
            //plateau.Show();
            //game.Run();
            Game1 game;
            
            game = new Game1();
            game.GenerateCarteAuto = cbCarteAuto.Checked;
            game.Run();
                  
        }

        private void btnRetour_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnAjoutEspece_Click(object sender, EventArgs e)
        {
            AjoutEspece f = new AjoutEspece();
            f.ShowDialog();
        }

    }
#endif
}